import React from 'react'
import {Outlet,useNavigate}from 'react-router-dom'

export default function Home() {

  const navigate = useNavigate()
  const toMusicHandle=()=>{
    navigate('/main/home/music/001?user=周杰伦',{
      state:[
        {id:'001',name:'伟大的作品'},
        {id:'002',name:'稻香'},
        {id:'003',name:'夜曲'},
      ]
    })
  }
  const toNewsHandle=()=>{
    navigate('/main/home/news/002?user=国际新闻',{
      state:[
        {id:'001',name:'今日要政'},
        {id:'002',name:'今日说法'},
        {id:'003',name:'财政税务'}
      ]
    })
  }
  return (
    <div>
      <h2>我是Home内容</h2>
      <button onClick={toMusicHandle}>Music</button>
      <button onClick={toNewsHandle}>News</button>
      <Outlet/>
    </div>
  )
}
